home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / GadUtil / Include / libraries / gadutil.i < prev   
Encoding:
Text File  |  1997-10-05  |  21.8 KB  |  647 lines

  1.     IFND    LIBRARIES_GADUTIL_I
  2. LIBRARIES_GADUTIL_I    SET    1
  3. **------------------------------------------------------------------------**
  4. *
  5. *    $VER: gadutil.i 37.10 (28.09.97)
  6. *
  7. *    Filename:    libraries/gadutil.i
  8. *    Version:    37.10
  9. *    Date:        28-Sep-97
  10. *
  11. *    Gadutil definitions, a dynamic gadget layout system.
  12. *
  13. *    © Copyright 1994-1997 by P-O Yliniemi and Staffan Hämälä.
  14. *
  15. *    All Rights Reserved.
  16. *
  17. **------------------------------------------------------------------------**
  18.  
  19.     IFND    EXEC_TYPES_I
  20.     INCLUDE    'exec/types.i'
  21.     ENDC
  22.  
  23.     IFND    EXEC_LIBRARIES_I
  24.     include    "exec/libraries.i"
  25.     ENDC
  26.  
  27.     IFND    UTILITY_TAGITEM_I
  28.     INCLUDE    'utility/tagitem.i'
  29.     ENDC
  30.  
  31.     IFND    INTUITION_INTUITION_I
  32.     INCLUDE    'intuition/intuition.i'
  33.     ENDC    
  34.  
  35.     IFND    LIBRARIES_GADTOOLS_H
  36.     INCLUDE 'libraries/gadtools.h'
  37.     ENDC
  38.  
  39. **------------------------------------------------------------------------**
  40. *
  41. * Extended gadget types available in GadUtil.library.
  42. *
  43.  
  44. IMAGE_KIND:            equ    50
  45. LABEL_KIND:            equ    51
  46. DRAWER_KIND:        equ    52
  47. FILE_KIND:        equ    53
  48. BEVELBOX_KIND:        equ    54
  49. PROGRESS_KIND:        equ    55
  50.  
  51. **-------------------- Reserved GadgetID's - don't use! ------------------**
  52. *
  53. * GadgetID's are really word sized, but two of these vaules are used by the
  54. * GU_HelpGadget tag, so don't use -1 (65535), -2 (65534) or -3 (65533) as
  55. * GadgetID!
  56. *
  57.  
  58. GADID_RESERVED:        equ    $FFFFFFFF
  59. WINTITLE_HELP:        equ    $FFFFFFFE
  60. SCRTITLE_HELP:        equ    $FFFFFFFD
  61.  
  62. **--------------- Minimum recommended sizes for some gadgets -------------**
  63. FILEKIND_WIDTH:        equ    20
  64. FILEKIND_HEIGHT:    equ    14
  65.  
  66. DRAWERKIND_WIDTH:    equ    20
  67. DRAWERKIND_HEIGHT:    equ    14
  68.  
  69. **------------------ Text placement for LABEL_KIND -----------------------**
  70. *
  71. *    ___1_____2_____3___
  72. *    |_____|_____|_____| A    Nine different placements of the text is
  73. *    |_____|_____|_____| B    possible if the size of the box allows it.
  74. *    |_____|_____|_____| C    The flags are the same as for BEVELBOX_KIND
  75. *
  76.  
  77. LB_TEXT_TOP:        equ    0    ; Place text on line A of the box
  78.  
  79. LB_TEXT_MIDDLE:        equ    1    ; Place text on line B of the box
  80.  
  81. LB_TEXT_BOTTOM:        equ    2    ; Place text on line C of the box
  82.  
  83. LB_TEXT_CENTER:        equ    0    ; Place text in column 2 of the box
  84.  
  85. LB_TEXT_LEFT:        equ    4    ; Place text in column 1 of the box
  86.  
  87. LB_TEXT_RIGHT:        equ    8    ; Place text in column 3 of the box
  88.  
  89. **----------------- Alternatives for text placement flags ----------------**
  90. LB_TEXT_TOP_CENTER:    equ    LB_TEXT_TOP!LB_TEXT_CENTER
  91. LB_TEXT_TOP_LEFT:    equ    LB_TEXT_TOP!LB_TEXT_LEFT
  92. LB_TEXT_TOP_RIGHT:    equ    LB_TEXT_TOP!LB_TEXT_RIGHT
  93.  
  94. LB_TEXT_MIDDLE_CENTER:    equ    LB_TEXT_MIDDLE!LB_TEXT_CENTER
  95. LB_TEXT_MIDDLE_LEFT:    equ    LB_TEXT_MIDDLE!LB_TEXT_LEFT
  96. LB_TEXT_MIDDLE_RIGHT:    equ    LB_TEXT_MIDDLE!LB_TEXT_RIGHT
  97.  
  98. LB_TEXT_BOTTOM_CENTER:    equ    LB_TEXT_BOTTOM!LB_TEXT_CENTER
  99. LB_TEXT_BOTTOM_LEFT:    equ    LB_TEXT_BOTTOM!LB_TEXT_LEFT
  100. LB_TEXT_BOTTOM_RIGHT:    equ    LB_TEXT_BOTTOM!LB_TEXT_RIGHT
  101.  
  102. **---------------------- Text shadow placement flags ---------------------**
  103. LB_SHADOW_DR:        equ    0    ; Place the shadow at x+1, y+1
  104. LB_SHADOW_UR:        equ    16    ; Place the shadow at x+1, y-1
  105. LB_SHADOW_DL:        equ    32    ; Place the shadow at x-1, y+1
  106. LB_SHADOW_UL:        equ    48    ; Place the shadow at x-1, y-1
  107.  
  108. **------------ Alternatives for text shadow placement flags --------------**
  109. LB_SUNAT_UL:        equ    0    ; Place the shadow at x+1, y+1
  110. LB_SUNAT_DL:        equ    16    ; Place the shadow at x+1, y-1
  111. LB_SUNAT_UR:        equ    32    ; Place the shadow at x-1, y+1
  112. LB_SUNAT_DR:        equ    48    ; Place the shadow at x-1, y-1
  113.  
  114. LB_3DTEXT:        equ    64    ; Alternative to GULB_3DText, TRUE
  115.  
  116. **----------------------- Bevel box frame types  -------------------------**
  117. BFT_BUTTON:        equ    0    ; Normal button bevel box border
  118. BFT_RIDGE:        equ    1    ; STRING_KIND bevel box border
  119. BFT_DROPBOX:        equ    2    ; Icon dropbox type border
  120.  
  121. BFT_HORIZBAR:        equ    10    ; Horizontal shadowed line
  122. BFT_VERTBAR:        equ    11    ; Vertical shadowed line
  123.  
  124. **------------------ Text placement for BEVELBOX_KIND --------------------**
  125. BB_TEXT_ABOVE:        equ    0    ; Place bevel box text above the
  126.                     ;  upper border     ___ Example ___
  127.  
  128. BB_TEXT_IN:        equ    1    ; Place bevel box text centered at
  129.                     ;  the upper border --- Example ---
  130.  
  131. BB_TEXT_BELOW:        equ    2    ; Place bevel box text below the
  132.                     ;  upper border     ___         ___
  133.                     ;                       Example
  134.  
  135. BB_TEXT_CENTER:        equ    0    ; Place the text centered at the
  136.                     ;  upper border (default)
  137.  
  138. BB_TEXT_LEFT:        equ    4    ; Place the text left adjusted
  139.  
  140. BB_TEXT_RIGHT:        equ    8    ; Place the text right adjusted
  141.  
  142. **----------------- Alternatives for text placement flags ----------------**
  143. BB_TEXT_ABOVE_CENTER:    equ    BB_TEXT_ABOVE!BB_TEXT_CENTER
  144. BB_TEXT_ABOVE_LEFT:    equ    BB_TEXT_ABOVE!BB_TEXT_LEFT
  145. BB_TEXT_ABOVE_RIGHT:    equ    BB_TEXT_ABOVE!BB_TEXT_RIGHT
  146.  
  147. BB_TEXT_IN_CENTER:    equ    BB_TEXT_IN!BB_TEXT_CENTER
  148. BB_TEXT_IN_LEFT:    equ    BB_TEXT_IN!BB_TEXT_LEFT
  149. BB_TEXT_IN_RIGHT:    equ    BB_TEXT_IN!BB_TEXT_RIGHT
  150.  
  151. BB_TEXT_BELOW_CENTER:    equ    BB_TEXT_BELOW!BB_TEXT_CENTER
  152. BB_TEXT_BELOW_LEFT:    equ    BB_TEXT_BELOW!BB_TEXT_LEFT
  153. BB_TEXT_BELOW_RIGHT:    equ    BB_TEXT_BELOW!BB_TEXT_RIGHT
  154.  
  155. **---------------------- Text shadow placement flags ---------------------**
  156. BB_SHADOW_DR:        equ    0    ; Place the shadow at x+1, y+1
  157. BB_SHADOW_UR:        equ    16    ; Place the shadow at x+1, y-1
  158. BB_SHADOW_DL:        equ    32    ; Place the shadow at x-1, y+1
  159. BB_SHADOW_UL:        equ    48    ; Place the shadow at x-1, y-1
  160.  
  161. **------------ Alternatives for text shadow placement flags --------------**
  162. BB_SUNAT_UL:        equ    0    ; Place the shadow at x+1, y+1
  163. BB_SUNAT_DL:        equ    16    ; Place the shadow at x+1, y-1
  164. BB_SUNAT_UR:        equ    32    ; Place the shadow at x-1, y+1
  165. BB_SUNAT_DR:        equ    48    ; Place the shadow at x-1, y-1
  166.  
  167. BB_3DTEXT:        equ    64    ; Alternative to GUBB_3DText, TRUE
  168.  
  169. **------------------------------------------------------------------------**
  170. *
  171. * This is the structure that actually holds the definition of a single
  172. * gadget.  It contains the new layout tags defined below, as well as the
  173. * normal GadTools tags.  You setup all the gadgets in a window by
  174. * making an array of this structure and passing it to GU_LayoutGadgetsA().
  175. *
  176.     STRUCTURE LayoutGadget,0
  177.         WORD lg_GadgetID        ; Gadget ID
  178.         APTR lg_LayoutTags        ; struct TagItem ptr
  179.         APTR lg_GadToolsTags        ; struct TagItem ptr
  180.         APTR lg_Gadget            ; struct Gadget ptr
  181.     LABEL lg_SIZEOF
  182.  
  183. **------------------------------------------------------------------------**
  184. *
  185. * Structure used to hold the built in strings of a localized program. These
  186. * strings will be used if we couldn't get a string from the catalog.
  187. *
  188. *
  189.     STRUCTURE AppString,0
  190.         ULONG    as_ID            ; String ID
  191.         APTR    as_Str            ; String pointer
  192.     LABEL as_SIZEOF
  193.  
  194. **------------------------------------------------------------------------**
  195. * A useful macro to fill a LayoutGadget structure.
  196. *
  197. * Usage:        GADGET  GadgetID,  Gad_LayoutTags,  Gad_GadToolsTags
  198. *
  199.  
  200. GADGET:    MACRO
  201.     dc.w    \1
  202.     dc.l    \2,\3,0
  203.     ENDM
  204.  
  205. LASTGAD: MACRO
  206.     dc.w    -1
  207.     dc.l    NULL,NULL,NULL
  208.     ENDM
  209.  
  210. **------------------------------------------------------------------------**
  211. * A macro to define a localized NewMenu structure
  212. *
  213. * Usage:        LOCMENU Type, Label ID, Flags, MutualExclude, UserData
  214. *
  215. * The string format for the label and shortcut key is:
  216. *
  217. *       SHORTCUTKEY, NULL, LABEL
  218. *
  219. * Use space for no shortcut.
  220. *
  221. * Examples:
  222. *
  223. * MNU_Edit_Cut:   dc.b  "X",0,"Cut"             ; Shortcut = Amiga X
  224. * MNU_Edit_Copy:  dc.b  "C",0,"Copy"            ; Shortcut = Amiga C
  225. * MNU_Edit_Paste: dc.b  "V",0,"Paste"           ; Shortcut = Amiga V
  226. * MNU_Edit_Erase: dc.b  " ",0,"Erase"           ; No shortcut
  227. *
  228.  
  229. LOCMENU: MACRO
  230.          dc.b    \1,0           ; Type, pad
  231.          dc.l    \2,0           ; Catalog string ID for label and cmd key
  232.          dc.w    \3             ; Flags
  233.          dc.l    \4,\5          ; MutualExclude, UserData
  234.          ENDM
  235.  
  236. **------------------------------------------------------------------------**
  237. *
  238. * Gadutil.library is basically an extension to Gadtools.library.  It adds
  239. * to GadTools the ability to dynamically layout gadgets according to the
  240. * positions of other gadgets, font size, locale, etc.  The goal in designing
  241. * this was to create a system so that programmers could easily create a GUI
  242. * that automatically adjusted to a user's environment.
  243. *
  244. * Every gadget is now defined as a TagList, there is no more need to make use
  245. * of the NewGadget structure as this taglist allows you to access all fields
  246. * used in that structure.  An array of the TagLists for all your window's
  247. * gadgets is then passed to GU_LayoutGadgetsA() and your gadget list is
  248. * created.
  249. *
  250.  
  251. GU_TagBase:    equ    TAG_USER+$60000
  252.  
  253. ************ Define which kind of gadget we are going to have. *************
  254.  
  255. GU_GadgetKind:    equ    GU_TagBase+1    ; Which kind of gadget to make.
  256.  
  257.  
  258. ********************** Gadget width control. *******************************
  259.  
  260. GU_Width:    equ    GU_TagBase+20    ; Absolute gadget width.
  261.  
  262. GU_DupeWidth:    equ    GU_TagBase+21    ; Duplicate the width of
  263.                     ;  another gadget
  264.  
  265. GU_AutoWidth:    equ    GU_TagBase+22    ; Set width according to length
  266.                     ;  of text label + ti_Data
  267.  
  268. GU_Columns:    equ    GU_TagBase+23    ; Set width so that approximately
  269.                     ;  ti_Data columns will fit.
  270.  
  271. GU_AddWidth:    equ    GU_TagBase+24    ; Add some value to the total
  272.                     ;  width calculation.
  273.  
  274. GU_MinWidth:    equ    GU_TagBase+25    ; Make sure width is at least this
  275.  
  276. GU_MaxWidth:    equ    GU_TagBase+26    ; Make sure width is at most this
  277.  
  278. GU_AddWidChar:    equ    GU_TagBase+27    ; Add length of ti_Data characters
  279.                     ;  to the gadget width
  280.  
  281. GU_FractWidth:    equ    GU_TagBase+28    ; Divide / multiply gadget width
  282.                     ;  with ti_Data
  283.  
  284. ********************** Gadget height control. ******************************
  285.  
  286. GU_Height:    equ    GU_TagBase+40    ; Absolute gadget height.
  287.  
  288. GU_DupeHeight:    equ     GU_TagBase+41    ; Duplicate the height of another
  289.                     ;  gadget.
  290.  
  291. GU_AutoHeight:    equ    GU_TagBase+42    ; Set height according to height
  292.                     ;  of text font + ti_Data.
  293.  
  294. GU_HeightFactor: equ    GU_TagBase+43    ; Make the gadget height a
  295.                     ;  multiple of the font height.
  296.  
  297. GU_AddHeight:    equ    GU_TagBase+44    ; Add some value to the total
  298.                     ;  height calculation
  299.  
  300. GU_MinHeight:    equ    GU_TagBase+45    ; Make sure height is at least this
  301.  
  302. GU_MaxHeight:    equ    GU_TagBase+46    ; Make sure height is at most this
  303.  
  304. GU_AddHeiLines:    equ    GU_TagBase+47    ; Add the height of ti_Data lines
  305.                     ;  to the gadget height
  306.  
  307. GU_FractHeight:    equ    GU_TagBase+48    ; Divide / multiply gadget height
  308.                     ;  with ti_Data
  309.  
  310. ******************** Gadget top edge control. ******************************
  311.  
  312. GU_Top:        equ    GU_TagBase+60    ; Absolute top edge.
  313.  
  314. GU_TopRel:    equ    GU_TagBase+61    ; Top edge relative to bottom
  315.                     ;  edge of another gadget.
  316.  
  317. GU_AddTop:    equ    GU_TagBase+62    ; Add some value to the final
  318.                      ;  top edge calculation.
  319.  
  320. GU_AlignTop:    equ    GU_TagBase+63    ; Align top edge of gadget with
  321.                     ;  top edge of another gadget.
  322.  
  323. GU_AdjustTop:    equ    GU_TagBase+64    ; Add the height of the text
  324.                     ;  font + ti_Data to the top edge.
  325.  
  326. GU_AddTopLines: equ    GU_TagBase+65    ; Add the height of ti_Data lines
  327.                     ;  to the top edge
  328.  
  329. ******************** Gadget bottom edge control. ***************************
  330.  
  331. GU_Bottom:    equ    GU_TagBase+80    ; Absolute bottom edge.
  332.  
  333. GU_BottomRel:    equ    GU_TagBase+81    ; Bottom edge relative to top
  334.                     ;  edge of another gadget.
  335.  
  336. GU_AddBottom:    equ    GU_TagBase+82    ; Add some value to the final
  337.                     ;  bottom edge calculation.
  338.  
  339. GU_AlignBottom:    equ    GU_TagBase+83    ; Align bottom edge of gadget with
  340.                     ;  bottom edge of another gadget.
  341.  
  342. GU_AdjustBottom: equ    GU_TagBase+84   ; Subtract the height of the text
  343.                                         ;  font + ti_Data from the top edge.
  344.  
  345. ************************ Gadget left edge control. *************************
  346.  
  347. GU_Left:    equ    GU_TagBase+100    ; Absolute left edge.
  348.  
  349. GU_LeftRel:    equ    GU_TagBase+101    ; Left edge relative to right
  350.                     ;  edge of another gadget.
  351.  
  352. GU_AddLeft:    equ    GU_TagBase+102    ; Add some value to the final
  353.                     ;  left edge calculation.
  354.  
  355. GU_AlignLeft:    equ    GU_TagBase+103    ; Align left edge of gadget with
  356.                     ;  left edge of another gadget.
  357.  
  358. GU_AdjustLeft:    equ    GU_TagBase+104    ; Add the width of the text
  359.                     ;  label + ti_Data to the left edge.
  360.  
  361. GU_AddLeftChar: equ    GU_TagBase+105    ; Add length of ti_Data characters
  362.                     ;  to the left edge.
  363.  
  364. *********************** Gadget right edge control. *************************
  365.  
  366. GU_Right:    equ    GU_TagBase+120    ; Absolute right edge.
  367.  
  368. GU_RightRel:    equ    GU_TagBase+121    ; Right edge relative to left
  369.                     ;  edge of another gadget.
  370.  
  371. GU_AddRight:    equ    GU_TagBase+122    ; Add some value to the final
  372.                     ;  right edge calculation.
  373.  
  374. GU_AlignRight:    equ    GU_TagBase+123    ; Align right edge of gadget with
  375.                     ;  right edge of another gadget.
  376.  
  377. GU_AdjustRight: equ     GU_TagBase+124  ; Subtract the width of the text
  378.                                         ; label + ti_Data from the left edge
  379.  
  380. ******************************** Other tags ********************************
  381.  
  382. GU_ToggleSelect: equ    GU_TagBase+150  ; Make the gadget toggleselect
  383.  
  384. GU_Selected:    equ     GU_TagBase+151  ; Change toggleselect default to
  385.                                         ;  selected.
  386.  
  387. GU_HelpGadget:    equ    GU_TagBase+152    ; Gadget ID of a TEXT_KIND gadget that
  388.                     ; will show a short help text
  389.  
  390. GU_HelpText:    equ    GU_TagBase+153    ; Pointer to the text to be shown in
  391.                     ; the help gadget
  392.  
  393. GU_LocaleHelp:    equ    GU_TagBase+154    ; Localized version of GU_HelpText
  394.                     ; ti_Data of this tag is the string ID
  395.  
  396. ************ Access to the other fields of the NewGadget structure. ********
  397.  
  398. GU_GadgetText:    equ    GU_TagBase+160    ;  Gadget label. 
  399.  
  400. GU_TextAttr:    equ    GU_TagBase+161    ;  Desired font for gadget label.
  401.  
  402. GU_Flags:    equ    GU_TagBase+162    ;  Gadget flags.
  403.  
  404. GU_UserData:    equ    GU_TagBase+163    ;  Gadget UserData.
  405.  
  406. GU_LocaleText:    equ    GU_TagBase+164    ;  Gadget label taken from a locale.
  407.  
  408. **************** Tags to store some of the calculated values ***************
  409.  
  410. GU_StoreLeft:    equ    GU_TagBase+170    ; Store the gadget's left position
  411. GU_StoreTop:    equ    GU_TagBase+171    ; Store the gadget's top position
  412. GU_StoreWidth:    equ    GU_TagBase+172    ; Store the gadget's width
  413. GU_StoreHeight:    equ    GU_TagBase+173    ; Store the gadget's height
  414. GU_StoreRight:    equ    GU_TagBase+174    ; Store the gadget's right position
  415. GU_StoreBottom:    equ    GU_TagBase+175    ; Store the gadget's bottom position
  416.  
  417. ***************** Tags for GadUtil's extended gadget kinds. ****************
  418.  
  419. **---------------------------- IMAGE_KIND tags ---------------------------**
  420. GUIM_Image:    equ    GU_TagBase+200    ; Image structure for an image
  421.                     ;  gadget
  422.  
  423. GUIM_ReadOnly:    equ    GU_TagBase+201    ; TRUE if read-only. 
  424.  
  425. GUIM_SelectImg: equ     GU_TagBase+202  ; Other image for IMAGE_KIND gadgets.
  426.  
  427. GUIM_BOOPSILook: equ    GU_TagBase+203  ; Change the look of the selected
  428.                                         ;  image on one-image-buttons.
  429.  
  430. **------------------------- BEVELBOX_KIND tags ---------------------------**
  431. GUBB_Recessed:    equ    GU_TagBase+220    ; TRUE for a recessed bevel box
  432.  
  433. GUBB_FrameType:    equ    GU_TagBase+221    ; Frame type for bevel box
  434.  
  435. GUBB_TextColor: equ    GU_TagBase+222    ; Color of title text above box
  436.  
  437. GUBB_TextPen:    equ    GU_TagBase+223    ; Pen to print title text with -
  438.                     ;  overrides GUBB_TextColor
  439.  
  440. GUBB_Flags:    equ    GU_TagBase+224    ; Text placement flags
  441.  
  442. GUBB_3DText:    equ    GU_TagBase+225    ; Tag to enable 3D text (shadow)
  443.                     ;  Not needed if GUBB_ShadowColor
  444.                     ;  or GUBB_ShadowPen is used
  445.  
  446. GUBB_ShadowColor: equ    GU_TagBase+226    ; Color of the title text's shadow
  447.  
  448. GUBB_ShadowPen:    equ    GU_TagBase+227    ; Pen to print the text's shadow
  449.                     ;  with - overrides GUBB_ShadowColor
  450.  
  451. **-------------------------- LABEL_KIND tags -----------------------------**
  452. GULB_TextColor: equ    GU_TagBase+222    ; Color of the text
  453.  
  454. GULB_TextPen:    equ    GU_TagBase+223    ; Pen to print text with -
  455.                     ;  overrides GULB_TextColor
  456.  
  457. GULB_Flags:    equ    GU_TagBase+224    ; Text placement flags
  458.  
  459. GULB_3DText:    equ    GU_TagBase+225    ; Tag to enable 3D text (shadow)
  460.                     ;  Not needed if GULB_ShadowColor
  461.                     ;  or GULB_ShadowPen is used
  462.  
  463. GULB_ShadowColor: equ    GU_TagBase+226    ; Color of the text's shadow
  464.  
  465. GULB_ShadowPen:    equ    GU_TagBase+227    ; Pen to print the text's shadow
  466.                     ;  with - overrides GULB_ShadowColor
  467.  
  468. **------------------------- PROGRESS_KIND tags ---------------------------**
  469. GUPR_FillColor:    equ    GU_TagBase+240    ; Color of filled part of indicator
  470.  
  471. GUPR_FillPen:    equ    GU_TagBase+241    ; Pen to fill the indicator with
  472.                     ;  - overrides GUPR_FillColor
  473.  
  474. GUPR_BackColor:    equ    GU_TagBase+242    ; Color of the background of the
  475.                     ;  indicator
  476.  
  477. GUPR_BackPen:    equ    GU_TagBase+243    ; Pen to use for the indocator's
  478.                     ;  background - overrides
  479.                     ;  GUPR_BackColor
  480.  
  481. GUPR_Current:    equ    GU_TagBase+244    ; Current value of the indicator
  482.  
  483. GUPR_Total:    equ    GU_TagBase+245    ; Total value for the indicator
  484.  
  485. ************** Tags passed directly to GU_LayoutGadgetsA(). ****************
  486.  
  487. GU_RightExtreme: equ    GU_TagBase+500    ; ti_Data is a pointer to a longword
  488.                     ;  that is used to store the right-
  489.                     ;  most point that a gadget will
  490.                     ;  exist in.
  491.  
  492. GU_LowerExtreme: equ    GU_TagBase+501    ; ti_Data is a pointer to a longword
  493.                     ;  that is used to store the lower-
  494.                     ;  most point that a gadget will
  495.                     ;  exist in.
  496.  
  497. GU_Catalog:    equ    GU_TagBase+502    ; Indicates locale for the gadgets. 
  498.  
  499. GU_DefTextAttr:    equ    GU_TagBase+503    ; Specifies a default font for use
  500.                     ;  with all gadgets, can still be
  501.                     ;  over-ridden with GU_TextAttr.
  502.  
  503. GU_AppStrings:    equ    GU_TagBase+504    ; Application string table w/IDs. 
  504.  
  505. GU_BorderLeft:    equ    GU_TagBase+505    ; Size of window left border. 
  506.  
  507. GU_BorderTop:    equ    GU_TagBase+506    ; Size of window top border. 
  508.  
  509. GU_NoCreate:    equ    GU_TagBase+507    ; Don't actually create the gadgets. 
  510.  
  511. GU_MinimumIDCMP: equ    GU_TagBase+508    ; Minimum required IDCMP, so that all
  512.                     ;  gadgets will work
  513.  
  514. GU_DefWTitle:    equ    GU_TagBase+509    ; Text to show in window title when
  515.                     ;  pointer is outside a gadget with
  516.                     ;  help text
  517.  
  518. GU_DefLocWTitle: equ    GU_TagBase+510    ; Localized default window title
  519.  
  520. GU_DefSTitle:    equ    GU_TagBase+511    ; Text to show in screen title when
  521.                     ;  pointer is outside a gadget with
  522.                     ;  help text
  523.  
  524. GU_DefLocSTitle: equ    GU_TagBase+512    ; Localized default screen title
  525.  
  526. GU_DefHelpText:    equ    GU_TagBase+513    ; Text to show in any gadget used to
  527.                     ;  display help text when pointer is
  528.                     ;  outside a gadget with help text
  529.  
  530. GU_DefLocHelpText: equ    GU_TagBase+514    ; Localized default help text
  531.  
  532. ****************************** Hotkey tags ***********************************
  533.  
  534. GU_Hotkey:    equ    GU_TagBase+300    ; Hotkey for gadget (VANILLAKEY)
  535.  
  536. ********************* Boolean flags for hotkey code **************************
  537.  
  538. GU_HotkeyCase:    equ    GU_TagBase+301    ; TRUE for case sensitive hotkey
  539. GU_LabelHotkey:    equ    GU_TagBase+302    ; TRUE = get hotkey code from label
  540. GU_RawKey:    equ    GU_TagBase+303    ; TRUE if hotkey is a RAWKEY code
  541.  
  542. *********************** Constants for hotkey support ***********************
  543.  
  544. GADUSERMAGIC:    equ    $1122        ; Identification for structure
  545.  
  546. ******************** Public bit numbers for gu_Flags ***********************
  547.  
  548. GU_HOTKEYCASE:    equ    0        ; Hotkey is case-sensitive
  549. GU_RAWKEY:    equ    2        ; Hotkey is a RAWKEY code
  550.  
  551. ******************** Structure gg_UserData points to ***********************
  552. *
  553. * This structure is the public part of the allocated data structure for
  554. * hotkeys and IMAGE_KIND gadgets (including FILE_KIND and DRAWER_KIND).
  555. *
  556. * This structure should be considered READ ONLY. The only fields you may
  557. * change is the gu_Code and gu_Flags fields.
  558. *
  559. * DO NOT WRITE ANYTHING BEYOND THIS STRUCTURE WITHOUT ALLOCATING MEMORY FIRST
  560.  
  561.     STRUCTURE    GU_Public,0
  562.         WORD    gu_Magic    ; Identification word for structure
  563.         LONG    gu_GadFlags    ; Flags for GENERIC kind GadUtil gadgets
  564.         BYTE    gu_Flags    ; Flags for the hotkey type
  565.         BYTE    gu_Code        ; VANILLA or RAWKEY code to react on
  566.         WORD    gu_Active    ; Active entry for some gadget kinds
  567.         WORD    gu_MaxVal    ; Maximum value for some gadgets
  568.         WORD    gu_MinVal    ; Minimum value for some gadgets
  569.         LONG    gu_GadgetType    ; Gadget type that was created
  570.         APTR    gu_HelpGadget    ; Pointer to gadget for help text
  571.         APTR    gu_HelpText    ; The help text for this gadget
  572.     LABEL    GUPU_SIZEOF
  573.  
  574. **------------------------------------------------------------------------**
  575. **                  Library base                  **
  576. **------------------------------------------------------------------------**
  577.  
  578.     STRUCTURE    GadUtilBase,LIB_SIZE
  579.         UBYTE    gub_Flags        ; Private!
  580.         UBYTE    gub_pad            ; Private!
  581.  
  582.                 APTR    gub_GadToolsBase    ; The following library bases
  583.                 APTR    gub_GfxBase        ;  may be read and used by
  584.                 APTR    gub_IntBase        ;  your program
  585.                 APTR    gub_LocaleBase        ; LocaleBase may be NULL!
  586.                 APTR    gub_UtilityBase
  587.         APTR    gub_DiskFontBase    ; DiskFontBase may be NULL!
  588.  
  589.         LONG    gub_SegList        ; Private!
  590.     LABEL    GadUtilBase_SIZEOF
  591.  
  592.  
  593. GADUTILNAME:    MACRO
  594.         dc.b    "gadutil.library",0
  595.         ENDM
  596.  
  597. GADUTIL_VER:    equ    37
  598. GADUTIL_REV:    equ    10
  599.  
  600. **------------------------------------------------------------------------**
  601. **                  BevelBox structure              **
  602. **------------------------------------------------------------------------**
  603.     STRUCTURE BBoxData,0
  604.         WORD    bbd_XPos        ; X position of box
  605.         WORD    bbd_YPos        ; Y position of box
  606.         WORD    bbd_Width        ; Width of box
  607.         WORD    bbd_Height        ; Height of box
  608.  
  609.         WORD    bbd_LeftEdge        ; Left edge of text
  610.         WORD    bbd_TopEdge        ; Top edge of text
  611.         WORD    bbd_TextWidth        ; Pixel width of text
  612.  
  613.         LONG    bbd_TextFont        ; Font to print text with
  614.         LONG    bbd_Text        ; Text to display
  615.         
  616.         BYTE    bbd_FrontPen        ; Text color
  617.         BYTE    bbd_Flags        ; Text placement flags
  618.         BYTE    bbd_Recessed        ; Recessed frame
  619.         BYTE    bbd_FrameType        ; Type of box frame
  620.         BYTE    bbd_ShadowPen        ; Shadow color
  621.         BYTE    bbd_Reserved1        ; No use in v36.53 - reserved!
  622.         APTR    bbd_HelpGadget        ; Pointer to gadget for help text
  623.         APTR    bbd_HelpText        ; The help text for this gadget
  624.     LABEL bbd_SIZEOF
  625.  
  626. **------------------------------------------------------------------------**
  627. **              ProgressIndicator structure              **
  628. **------------------------------------------------------------------------**
  629.  
  630.     STRUCTURE ProgressGad,0
  631.         WORD    pg_XPos            ; X pos of box around gadget
  632.         WORD    pg_YPos            ; Y pos of box around gadget
  633.         WORD    pg_Width        ; Width of box around gadget
  634.         WORD    pg_Height        ; Height of box around gadget
  635.         LONG    pg_Current        ; Current value of indicator
  636.         LONG    pg_Total        ; Total value of indicator
  637.         BYTE    pg_FillColor        ; Color of upto current value
  638.         BYTE    pg_BackColor        ; Color from current to end
  639.         BYTE    pg_Flags        ; Flags
  640.         BYTE    pg_reserved1
  641.         WORD    pg_XFilledTo        ; Initialized to pg_XPos + 4
  642.         APTR    pg_HelpGadget        ; Pointer to gadget for help text
  643.         APTR    pg_HelpText        ; The help text for this gadget
  644.     LABEL pg_SIZEOF
  645.  
  646.     ENDC                            ; gadutil.i
  647.